<?php

/**
 * empty 判断
 * Class Fun1
 */
class Fun1{
    /**
     * @return bool true
     */
    public static function test1(){
        $param = "";
        return empty($param);
    }

    /**
     * @return bool true
     */
    public static function test2(){
        $param = array();
        return empty($param);
    }

    /**
     * @return bool true
     */
    public static function test3(){
        $param = 0;
        return empty($param);
    }

    /**
     * @return bool true
     */
    public static function test4(){
        $param = false;
        return empty($param);
    }

    /**
     * @return bool false
     */
    public static function test5(){
        $param = json_encode(array());
        return empty($param);
    }

    /**
     * @return bool false
     */
    public static function test6(){
        $param = true;
        return empty($param);
    }

    /**
     * @return bool false
     */
    public static function test7(){
        $param = 1;
        return empty($param);
    }

    /**
     * @return bool false
     */
    public static function test8(){
        $param = "1";
        return empty($param);
    }
}

var_dump(Fun1::test1());//true
var_dump(Fun1::test2());//true
var_dump(Fun1::test3());//true
var_dump(Fun1::test4());//true
var_dump(Fun1::test5());//false
var_dump(Fun1::test6());//false
var_dump(Fun1::test7());//false
var_dump(Fun1::test8());//false
die();
